<?php session_start();
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Food Online</title>
	<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
    <style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
    </style>
</head>
<body>
<div id="wrapper">
<div id="logo">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="200" border="0" align="center">
    <tr>
      <td height="30"><FONT size="+6">
        <div align="center">STMS</div></td>
    </tr>
    <tr>
      <td><div align="center">STUDENT MANAGEMENT SYSTEM</div></td>
    </tr>
</table>
  <p>&nbsp;</p>
</div>
    <div id="nav">
      <div id="nav-left">
        <ul>
          <li><a href="HometoAdmin.php">Home</a></li>
          <li class="orange">
            <div align="left"><a href="http://localhost/stms/pages/data/logout.php">Logout-<?php include_once 'data/databaseconnection.php';session_start();echo $_SESSION['username'];?></a></div>
          </li>
        </ul>
      </div>
      <div id="nav-right">
        <ul>
         
           <li><a href="Aboutus.php">About us</a></li>
          <li><a href="viewhome.php">Student</a></li>
          <li><a href="Adminhome.php">Admin</a></li>
          <li><a href="http://studentmanagements.blogspot.com/">Contact</a></li>
        </ul>
      </div>
    </div>
	<style type="text/css">
			div.scrollbar {
				height: 500px;
				overflow: auto;
				border: solid 1px #000;
				padding: 5px;
				width:700px;
			}
		</style>
		
    <div id="body">
      <div class="clear">&nbsp;
        <div align="right"><font size="+1"><a href="changepass.php">changepassword</a></font>
        </div>
        <form id="form1" method="post" action="">
          <p>&nbsp;</p>
          <p>Basic Details </p>
		  <?php
		  
		  require_once 'data/databaseconnection.php';
		  
		   
		   $pass1=$_SESSION['password'];
		   $pass=md5($pass1);
		   $user=$_SESSION['username'];
		   //$a=mysql_query("SELECT*FROM user WHERE password='$pass' AND username='$user'");
		
			//$a=mysql_query("SELECT Regno FROM user WHERE password='$pass' AND username='$user' LEFT JOIN SELECT Regno FROM basicdetails ");
		//$a=mysql_query("SELECT *FROM basicdetails WHERE Regno in (SELECT Regno FROM user WHERE Password='$pass')");
		// echo mysql_num_rows($a);
		
   
		 
		 // $b=mysql_query("SELECT * FROM basicdetails WHERE Regno='$reg'");
			//while($row2=mysql_fetch_array($b)&&$row1=mysql_fetch_array($a))
			
			
				//if($row1['Regno']==$row2['Regno'])
				//if($a['Regno']==$b['Regno'])
				
				echo  "<div class=scrollbar >";
			echo "<table border=1>";
			
			echo "<tr>";
			echo "<td>Regno</th>";
			echo "<th>Title</th>";
			echo "<th>Firstname</th>";
			echo "<th>Lastname</th>";
			echo "<th>NICno</th>";
			echo "<th>Gender</th>";
			echo "<th>Civilstatus</th>";
			echo "<th>DOB</th>";
			echo "<th>Nationality</th>";
			echo "<th>Religion</th>"; 
			echo "<th>Permanentaddress</th>";
			echo "<th>Temporaryaddress </th>";
			echo "<th>Faculty</th>";
			echo "<th>CourseOfStudy </th>";
			echo "<th>AcademicYear</th>";
			echo "<th>District</th>";
			
			
			
			
			$result=mysql_query("SELECT * FROM basicdetails");
			while($row=mysql_fetch_array($result))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Title'];
				echo "<td>".$row['Firstname'];
				echo "<td>".$row['Lastname'];
				echo "<td>".$row['NICno'];
				echo "<td>".$row['Gender'];
				echo "<td>".$row['Civilstatus'];
				echo "<td>".$row['DOB'];
				echo "<td>".$row['Nationality'];
				echo "<td>".$row['Religion']; 
				echo "<td>".$row['Permanentaddress'];
				echo "<td>".$row['Temporaryaddress'];
				echo "<td>".$row['Faculty'];
				echo "<td>".$row['CourseOfStudy'];
				echo "<td>".$row['AcademicYear'];
				echo "<td>".$row['District'];
				echo "</tr>";
			}
			echo "</table>";
			
			echo "</div>";
			
			
			
		  ?>
          <!--
		  <table width="750" border="1">
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
          </table>
		  -->
          <p>&nbsp;</p>
          <p>&nbsp; </p>
          <p>
            <label for="textfield"></label>
          G.C.E A/L </p>
          <?php
		  require_once 'data/databaseconnection.php';
			echo "<table border=1>";
			echo "<tr>";
			echo "<th>Regno</th>";
			echo "<th>Indexno</th>";
			echo "<th>Year</th>";
			echo "<th>School</th>";
			echo "<th>District </th>";
			echo "<th>Stream</th>";
			echo "<th>Result </th>";
			echo "<th>Zscore</th>";
			echo "<th>DistrictRank</th>";
			echo "<th>IslandRank</th>";
			
			$result=mysql_query("SELECT * FROM gcealdetails");
			while($row=mysql_fetch_array($result))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Indexno'];
				echo "<td>".$row['Year'];
				echo "<td>".$row['School'];
				echo "<td>".$row['District'];
				echo "<td>".$row['Stream'];
				echo "<td>".$row['Result'];
				echo "<td>".$row['Zscore'];
				echo "<td>".$row['DistrictRank'];
				echo "<td>".$row['IslandRank'];
				echo "</tr>";
			}
			echo "</table>";
			
		  ?>
		  <p>&nbsp;</p>
          <p>&nbsp; </p>
		  <p>
            <label for="textfield"></label>
          Combination </p>
		  </p>
		  <p>
		    <?php
		  
		  echo "<table border=1>";
			echo "<tr>";
			echo "<td>Regno</th>";
			echo "<th>Course1</th>";
			echo "<th>Course2</th>";
			echo "<th>Course3</th>";
			
			
			
			$result=mysql_query("SELECT * FROM combination");
			
    
			while($row=mysql_fetch_array($result))
			{
		
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Course1'];
				echo "<td>".$row['Course2'];
				echo "<td>".$row['Course3'];
				echo "</tr>";
			}
			echo "</table>";
		  ?>
	      </p>
		  <p>&nbsp;</p>
		  <p>&nbsp;</p>
		  <p>
		    <?php
		  echo "ATTENDENCE DETAILS";
			echo '<table border="1">';
				echo "<tr>";
				echo "<th>DATE</th>";
				echo "<th>TIME</th>";
				echo "<td>SUBJECTCODE</th>";
				echo "<th>NOOFPRESENT</th>";
				$attend=mysql_query("SELECT * FROM attendence");
				while($row=mysql_fetch_array($attend))
			{
				echo "<tr><td>".$row['Date'];
				echo "<td>".$row['Time'];
				echo "<td>".$row['SubjectCode'];
				echo "<td>".$row['Noofpresent'];


			}
			echo "</table>";
		  ?>
	      </p>
		  <p>&nbsp;</p>
		  <p>&nbsp;</p>
		  <p>&nbsp;</p>
		  <p>
		    
		    <?php
		  echo "RESULTS DETAILS";
		  echo "<table border=1>";
			echo "<tr>";
			echo "<th>Regno</th>";
			echo "<th>Indexno</th>";
			echo "<th>SubjectCode</th>";
			echo "<th>Grade</th>";
			
			
			$result=mysql_query("SELECT * FROM results");
			while($row=mysql_fetch_array($result))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Indexno'];
				echo "<td>".$row['SubjectCode'];
				echo "<td>".$row['Grade'];
				
			}
			echo "</table>";
		  ?>
	      </p>
		  <p>&nbsp;</p>
        </form>
      </div>
      <div id="footer">
        <ul>
          <li><a href="http://www.freewebsitetemplates.com">Home</a> | </li>
          <li><a href="Aboutus.php">About Us</a> | </li>
          <li><a href="">Menu</a> | </li>
          <li><a href="http://studentmanagements.blogspot.com/">Contact</a></li>
        </ul>
        <p>copyright &copy;STMS Group03</p>
      </div>
  </div>
</div>
</body>
</html>
